package com.example.xiongmao.config;

import com.example.xiongmao.properties.AliOssProperties;
import com.example.xiongmao.utils.AliOssUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {
    @Bean
    public AliOssUtils aliOssUtil(AliOssProperties aliOssProperties){
        System.out.println("开始初始化aliOssUtil对象");
        AliOssUtils aliOssUtil = new AliOssUtils(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKeyId(),
                aliOssProperties.getAccessKeySecret(), aliOssProperties.getBucketName());
        return aliOssUtil;
    }
}
